Integrand size = 25, antiderivative size = 317 \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=-\frac {\left (a^2+2 a b-b^2\right ) e^{3/2} \arctan \left (1-\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}+\frac {\left (a^2+2 a b-b^2\right ) e^{3/2} \arctan \left (1+\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}-\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}-\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)-\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}+\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)+\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d} \]
[Out]
Time = 0.38 (sec) , antiderivative size = 317, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3624, 3609, 3615, 1182, 1176, 631, 210, 1179, 642} \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=-\frac {e^{3/2} \left (a^2+2 a b-b^2\right ) \arctan \left (1-\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}+\frac {e^{3/2} \left (a^2+2 a b-b^2\right ) \arctan \left (\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}+1\right )}{\sqrt {2} d}-\frac {e^{3/2} \left (a^2-2 a b-b^2\right ) \log \left (\sqrt {e} \cot (c+d x)-\sqrt {2} \sqrt {e \cot (c+d x)}+\sqrt {e}\right )}{2 \sqrt {2} d}+\frac {e^{3/2} \left (a^2-2 a b-b^2\right ) \log \left (\sqrt {e} \cot (c+d x)+\sqrt {2} \sqrt {e \cot (c+d x)}+\sqrt {e}\right )}{2 \sqrt {2} d}-\frac {2 e \left (a^2-b^2\right ) \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e} \]
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3609
Rule 3615
Rule 3624
Rubi steps \begin{align*} \text {integral}& = -\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}+\int (e \cot (c+d x))^{3/2} \left (a^2-b^2+2 a b \cot (c+d x)\right ) \, dx \\ & = -\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}+\int \sqrt {e \cot (c+d x)} \left (-2 a b e+\left (a^2-b^2\right ) e \cot (c+d x)\right ) \, dx \\ & = -\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}+\int \frac {-\left (\left (a^2-b^2\right ) e^2\right )-2 a b e^2 \cot (c+d x)}{\sqrt {e \cot (c+d x)}} \, dx \\ & = -\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}+\frac {2 \text {Subst}\left (\int \frac {\left (a^2-b^2\right ) e^3+2 a b e^2 x^2}{e^2+x^4} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{d} \\ & = -\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}+\frac {\left (\left (a^2-2 a b-b^2\right ) e^2\right ) \text {Subst}\left (\int \frac {e-x^2}{e^2+x^4} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{d}+\frac {\left (\left (a^2+2 a b-b^2\right ) e^2\right ) \text {Subst}\left (\int \frac {e+x^2}{e^2+x^4} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{d} \\ & = -\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}-\frac {\left (\left (a^2-2 a b-b^2\right ) e^{3/2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {e}+2 x}{-e-\sqrt {2} \sqrt {e} x-x^2} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}-\frac {\left (\left (a^2-2 a b-b^2\right ) e^{3/2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {e}-2 x}{-e+\sqrt {2} \sqrt {e} x-x^2} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}+\frac {\left (\left (a^2+2 a b-b^2\right ) e^2\right ) \text {Subst}\left (\int \frac {1}{e-\sqrt {2} \sqrt {e} x+x^2} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{2 d}+\frac {\left (\left (a^2+2 a b-b^2\right ) e^2\right ) \text {Subst}\left (\int \frac {1}{e+\sqrt {2} \sqrt {e} x+x^2} \, dx,x,\sqrt {e \cot (c+d x)}\right )}{2 d} \\ & = -\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}-\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)-\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}+\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)+\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}+\frac {\left (\left (a^2+2 a b-b^2\right ) e^{3/2}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}-\frac {\left (\left (a^2+2 a b-b^2\right ) e^{3/2}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d} \\ & = -\frac {\left (a^2+2 a b-b^2\right ) e^{3/2} \arctan \left (1-\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}+\frac {\left (a^2+2 a b-b^2\right ) e^{3/2} \arctan \left (1+\frac {\sqrt {2} \sqrt {e \cot (c+d x)}}{\sqrt {e}}\right )}{\sqrt {2} d}-\frac {2 \left (a^2-b^2\right ) e \sqrt {e \cot (c+d x)}}{d}-\frac {4 a b (e \cot (c+d x))^{3/2}}{3 d}-\frac {2 b^2 (e \cot (c+d x))^{5/2}}{5 d e}-\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)-\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d}+\frac {\left (a^2-2 a b-b^2\right ) e^{3/2} \log \left (\sqrt {e}+\sqrt {e} \cot (c+d x)+\sqrt {2} \sqrt {e \cot (c+d x)}\right )}{2 \sqrt {2} d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 2.17 (sec) , antiderivative size = 224, normalized size of antiderivative = 0.71 \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=-\frac {(e \cot (c+d x))^{3/2} \left (\frac {2}{5} b^2 \cot ^{\frac {5}{2}}(c+d x)-\frac {4}{3} a b \cot ^{\frac {3}{2}}(c+d x) \left (-1+\operatorname {Hypergeometric2F1}\left (\frac {3}{4},1,\frac {7}{4},-\cot ^2(c+d x)\right )\right )+\frac {1}{4} \left (a^2-b^2\right ) \left (2 \sqrt {2} \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )-2 \sqrt {2} \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )+8 \sqrt {\cot (c+d x)}+\sqrt {2} \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )-\sqrt {2} \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )\right )\right )}{d \cot ^{\frac {3}{2}}(c+d x)} \]
[In]
[Out]
Time = 0.03 (sec) , antiderivative size = 360, normalized size of antiderivative = 1.14
method | result | size |
derivativedivides | \(-\frac {2 \left (\frac {b^{2} \left (e \cot \left (d x +c \right )\right )^{\frac {5}{2}}}{5}+\frac {2 a e b \left (e \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+a^{2} e^{2} \sqrt {e \cot \left (d x +c \right )}-\sqrt {e \cot \left (d x +c \right )}\, b^{2} e^{2}-e^{3} \left (\frac {\left (a^{2} e -b^{2} e \right ) \left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 e^{2}}+\frac {a b \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (e^{2}\right )^{\frac {1}{4}}}\right )\right )}{d e}\) | \(360\) |
default | \(-\frac {2 \left (\frac {b^{2} \left (e \cot \left (d x +c \right )\right )^{\frac {5}{2}}}{5}+\frac {2 a e b \left (e \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+a^{2} e^{2} \sqrt {e \cot \left (d x +c \right )}-\sqrt {e \cot \left (d x +c \right )}\, b^{2} e^{2}-e^{3} \left (\frac {\left (a^{2} e -b^{2} e \right ) \left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 e^{2}}+\frac {a b \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (e^{2}\right )^{\frac {1}{4}}}\right )\right )}{d e}\) | \(360\) |
parts | \(-\frac {2 a^{2} e \left (\sqrt {e \cot \left (d x +c \right )}-\frac {\left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8}\right )}{d}-\frac {2 b^{2} \left (\frac {\left (e \cot \left (d x +c \right )\right )^{\frac {5}{2}}}{5}-\sqrt {e \cot \left (d x +c \right )}\, e^{2}+\frac {e^{2} \left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8}\right )}{d e}+\frac {2 a b \left (-\frac {2 \left (e \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+\frac {e^{2} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (e^{2}\right )^{\frac {1}{4}}}\right )}{d}\) | \(480\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1313 vs. \(2 (260) = 520\).
Time = 0.30 (sec) , antiderivative size = 1313, normalized size of antiderivative = 4.14 \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=\int \left (e \cot {\left (c + d x \right )}\right )^{\frac {3}{2}} \left (a + b \cot {\left (c + d x \right )}\right )^{2}\, dx \]
[In]
[Out]
Exception generated. \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=\int { {\left (b \cot \left (d x + c\right ) + a\right )}^{2} \left (e \cot \left (d x + c\right )\right )^{\frac {3}{2}} \,d x } \]
[In]
[Out]
Time = 15.24 (sec) , antiderivative size = 1274, normalized size of antiderivative = 4.02 \[ \int (e \cot (c+d x))^{3/2} (a+b \cot (c+d x))^2 \, dx=\text {Too large to display} \]
[In]
[Out]